package org.wenhuayuan.project.main.demo.demoDataItem

import android.view.View
import android.widget.ImageView
import androidx.recyclerview.widget.RecyclerView
import org.wenhuayuan.project.main.R
import org.wenhuayuan.uilibrary.hiitem.HiDataItem

class ItemTabDataItem(data: ItemData?) : HiDataItem<ItemData, RecyclerView.ViewHolder>(data) {
    override fun onBindData(holder: RecyclerView.ViewHolder, position: Int) {
        holder.itemView.findViewById<ImageView>(R.id.item_image).setImageResource(R.drawable.item_tab)
    }

//    override fun onBindData(holder: MyViewHolder, position: Int) {
//        holder!!.imageView.setImageResource(R.drawable.item_tab)
//    }

    override fun getItemLayoutRes(): Int {
        return R.layout.layout_list_item_tab
    }

    class MyViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
        var imageView: ImageView

        init {
            imageView = itemView.findViewById(R.id.item_image)
        }
    }
}
